<?php
class AreaController extends Controller {
	public function actionIndex() {
		$this->render ( 'index' );
	}
	public function actionCreate() {
		$this->render ( 'create' );
	}
	public function actionView() {
		$this->render ( 'view' );
	}
	public function actionUpdate() {
		$this->render ( 'update' );
	}
	public function actionList() {
		
		$dataProvider = Area::model()->search();
		
		$treeData = $dataProvider->buildTree();
		//echo '<pre>';
		//print_r($treeData);
		foreach($treeData as $key=>$model){
			echo "<BR><BR>";
			print_r($model->attributes);
			if ($model->children==false) continue;
			// print_r($model->children);
			foreach($model->children as $key=>$children){
				echo "<BR><BR>";
				print_r($children->attributes);
			}
			// break;
		}
		//echo '<pre>';
		//print_r($dataProvider);
		$this->render ( 'list', array (
				'dataProvider' => $dataProvider 
		) );
	}
}
?>